import formBuilder from "@/comps/form/formBuilder";
import api from "./api";
/*
fb.addText("sn","单据编号",3)
fb.addText("title","单据主题",3)
fb.addText("status","状态",3)
fb.addText("isClose","是否关闭",3)
fb.addText("formAt","制单时间",3)
fb.addText("needAt","需求时间",3)
fb.addText("formEmp","制单人",3)
fb.addText("createEmp","创建人",3)
fb.addText("needEmp","需求人",3)
fb.addText("needDept","需求部门",3)
fb.addText("note","备注",3)
fb.addText("product","产品",3)
fb.addText("flow","审批流程",3)
fb.addText("flowIndex","当前审批节点",3)
fb.addText("flowName","当前审批节点",3)
fb.addText("flowCur","当前审批节点",3)
fb.addText("flows","审批过程",3)
fb.addText("isConfirm","是否生效",3)
fb.addText("confirmAt","生效时间",3)
fb.addText("isCancel","是否取消",3)
fb.addText("isLock","是否锁定",3)
fb.addText("approvalSate","评审状态",3)
fb.addText("approvalStage","评审环节",3)

* */
export default {
    main:function () {
        let fb = formBuilder()
        fb.setLabelWidth(100)

        fb.addText("name").setSpan(3).setLabel("姓名")

        fb.addText("sort").setSpan(3).setLabel("排序").setTypeNumber()

        return fb
    },
    tree:function () {
        let fb = formBuilder()
        fb.setLabelWidth(100)

        fb.addCascade("parentId").setLabel("上级分类").setSpan(3)
            .setApi(api.urlTree)

        fb.addText("name").setSpan(6).setLabel("分类名称")
            .setRules([fb.R.notNull("名称不能为空")])

        fb.addText("sort").setSpan(3).setLabel("排序").setTypeNumber()
        return fb
    },
    other:function () {
        let fb = formBuilder()
        fb.setLabelWidth(100).setLabelPosition("right")

        return fb
    }
}